package test;

public class ThreadStateDemo {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            System.out.println("线程执行中...");
        });

        System.out.println("线程状态1：" + t.getState());
        t.start();
        System.out.println("线程状态2：" + t.getState());

        Thread.sleep(1000);
        System.out.println("线程状态3：" + t.getState());

        t.join();
        System.out.println("线程状态4：" + t.getState());
    }
}
